﻿using System.Web.Mvc;
using Hasiu.Entity;
using Hasiu.Service;
using Hasiu.Mvc.Filters;
using Hasiu.Mvc.Infrastructure;

namespace Hasiu.Mvc.Controllers.Admin
{
    [AdminAuthorize]
    public class TextShowAdminController : Controller
    {
        public ActionResult Save(string id)
        {
            TextShow textShow = null;
            if (!string.IsNullOrEmpty(id))
            {
                textShow = TextShowService._.Get(id);
            }
            return View(textShow);
        }

        [HttpPost]
        [ValidateInput(false)]
        public ActionResult Save(TextShow textShow)
        {
            TextShowService._.Update(textShow);
            return new RedirectOfUpdateResult("/admin/textshow/" + textShow.Id + ".aspx");
        }
    }
}
